using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace TPDSConfig
{
    public static class ErrorLog
    {

        public static void WriteError(string exception, string message)
        {
            System.Diagnostics.EventLog.WriteEntry("ImageReview", exception + "|" + message, System.Diagnostics.EventLogEntryType.Error);

            /*
            TextWriter tw = null;
            try
            {
                string filename = AppDomain.CurrentDomain.BaseDirectory + "TPDSErrorlog.txt";
                FileInfo fi = new FileInfo(filename);

                if ((fi.Exists) && (fi.Length / 1000 >= 1000)) //IF file >= 1MB
                {
                    fi.Delete();
                }
                tw = new StreamWriter(filename,true);
                tw.WriteLine("*** " + DateTime.Now.ToString() + " ***");
                tw.WriteLine(exception);
                tw.WriteLine(message);
                tw.WriteLine();
            }
            catch
            {
                //do nothing
            }
            finally
            {
                if (tw != null)
                {
                    tw.Close();
                    tw = null;
                }

            }
             */

        }
    }
}
